typedef struct mac_address {
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
	u_char byte5;
	u_char byte6;
}mac_address;


typedef struct ip_address {
	u_char byte1;
	u_char byte2;
	u_char byte3;
	u_char byte4;
}ip_address;

typedef struct ip_header{
    u_char  ver_ihl;        // Version (4 bits) + Internet header length (4 bits)
    u_char  tos;            // Type of service 
    u_short tlen;           // Total length 
    u_short identification; // Identification
    u_short flags_fo;       // Flags (3 bits) + Fragment offset (13 bits)
    u_char  ttl;            // Time to live
    u_char  proto;          // Protocol
    u_short crc;            // Header checksum
    ip_address  saddr;      // Source address
    ip_address  daddr;      // Destination address
    u_int   op_pad;         // Option + Padding
}ip_header;

typedef struct address_group {
	ip_address isrc, idest;
	mac_address msrc, mdest;
	u_short psrc, pdest;
}address_group;

typedef struct table_entry {
	ip_address hsip;
	mac_address hsmac;
	u_short wanport, lanport;
	table_entry *next;
}table_entry;

typedef struct subnet_entry {
	ip_address ip;
	mac_address mac;
	subnet_entry *next;
}subnet_entry;